﻿using Microsoft.EntityFrameworkCore;
using XLZF.MicroServices.ModelMigration;

namespace XLZF.MicroServices.AuthenticationCenter.IdentityUserStore;

public static class IIdentityServerBuilderUserStoreExtensions
{
    public static IIdentityServerBuilder AddUserStore(this IIdentityServerBuilder builder, Action<DbContextOptionsBuilder> userStoreOptions = null)
    {
        builder.Services.AddDbContext<UserStoreDbContext>(userStoreOptions);

        builder.Services.AddTransient<UserStore>();

        return builder;
    }
}
